package com.huawei.simplepiano.fraction;

import com.huawei.simplepiano.ResourceTable;
import com.huawei.simplepiano.utils.ConstantUtils;
import com.huawei.simplepiano.utils.RangeSelectionUtils;
import ohos.aafwk.content.Intent;
import ohos.agp.components.*;
import ohos.app.Context;

public class RangeTwoFraction extends BaseFraction {

    private final Context mContext;


    public RangeTwoFraction(Context context) {
        this.mContext = context;
    }

    @Override
    protected int getLayout() {
        return ResourceTable.Layout_range_two;
    }

    @Override
    public String fractionName() {
        return ConstantUtils.TWO_FRACTION;
    }

    @Override
    protected void initView() {
        rangeSelectionUtils.startLocalAudioPlay(mContext);
        DirectionalLayout whiteTwoLayout = (DirectionalLayout) getFractionAbility().findComponentById(ResourceTable.Id_two_whiteKey);
        rangeSelectionUtils.setFraction(this);
        rangeSelectionUtils.setContext(this);
        whiteTwoLayout.setTouchEventListener(rangeSelectionUtils.getTouchEventListener());
        rangeSelectionUtils.initButton(ConstantUtils.TWO_FRACTION);
    }

    @Override
    protected void onStop() {
        super.onStop();
    }

}
